package com.kangyi.admin.mapper;

import com.kangyi.vo.RegionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface RegionMapper {

    @Select("select * from region")
    List<RegionVO> inquiryRegion();

    @Select("SELECT DISTINCT city FROM region")
    List<String> getAllCities();

    @Select("SELECT id, district FROM region WHERE city like concat('%',#{city},'%')")
    List<RegionVO> getDistrictsByCity(String city);

    RegionVO getRegionById(Integer nursingHomeId);
}
